package wyn.dao.impl;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import wyn.dao.UserDaoI;
import wyn.entity.SysName;

import java.io.Serializable;

/**
 * Created by 王亚楠 on 2016/2/21.
 */
@Repository("userDao")
public class UserDaoImpl  implements UserDaoI {

    private SessionFactory sessionFactory;

    public SessionFactory getSessionFactory() {
        return sessionFactory;
    }

    @Autowired
    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }

    public Serializable save(SysName user) {
        return this.sessionFactory.getCurrentSession().save(user);
    }
}
